home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmBitSetOperations
- BorderStyle = 1 'Fixed Single
- Caption = "Bit-Set Demo In Visual Basic"
- ClientHeight = 2520
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 6045
- Icon = "BitSet.frx":0000
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2520
- ScaleWidth = 6045
- StartUpPosition = 2 'CenterScreen
- Begin VB.OptionButton optNumber
- Caption = "Binary"
- Height = 195
- Index = 1
- Left = 270
- TabIndex = 13
- Top = 1395
- Width = 1590
- End
- Begin VB.OptionButton optNumber
- Caption = "Long Integer"
- Height = 195
- Index = 0
- Left = 270
- TabIndex = 12
- Top = 810
- Value = -1 'True
- Width = 1545
- End
- Begin VB.CommandButton cmddone
- Caption = "done"
- Height = 375
- Left = 4950
- TabIndex = 11
- Top = 1755
- Width = 975
- End
- Begin VB.CommandButton cmdeqv
- Caption = "eqv"
- Height = 375
- Left = 4950
- TabIndex = 10
- Top = 945
- Width = 975
- End
- Begin VB.CommandButton cmdimp
- Caption = "imp"
- Height = 375
- Left = 4950
- TabIndex = 9
- Top = 540
- Width = 975
- End
- Begin VB.CommandButton cmdxor
- Caption = "xor"
- Height = 375
- Left = 3600
- TabIndex = 8
- Top = 1755
- Width = 975
- End
- Begin VB.CommandButton cmdor
- Caption = "or"
- Height = 375
- Left = 3600
- TabIndex = 7
- Top = 1350
- Width = 975
- End
- Begin VB.CommandButton cmdand
- Caption = "and"
- Height = 375
- Left = 3600
- TabIndex = 6
- Top = 945
- Width = 975
- End
- Begin VB.CommandButton cmdnot
- Caption = "not"
- Height = 375
- Left = 3600
- TabIndex = 5
- Top = 540
- Width = 975
- End
- Begin VB.CommandButton cmdror
- Caption = "ror"
- Height = 375
- Left = 2205
- TabIndex = 4
- Top = 1755
- Width = 975
- End
- Begin VB.CommandButton cmdrol
- Caption = "rol"
- Height = 375
- Left = 2205
- TabIndex = 3
- Top = 1350
- Width = 975
- End
- Begin VB.CommandButton cmdshl
- Caption = "shl"
- Height = 375
- Left = 2205
- TabIndex = 2
- Top = 540
- Width = 975
- End
- Begin VB.CommandButton cmdshr
- Caption = "shr"
- Height = 375
- Left = 2205
- TabIndex = 1
- Top = 945
- Width = 975
- End
- Begin VB.TextBox txtNumber
- Alignment = 1 'Right Justify
- Appearance = 0 'Flat
- BeginProperty Font
- Name = "Courier New"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 90
- MaxLength = 16
- TabIndex = 0
- Top = 90
- Width = 5880
- End
- Begin VB.Shape shShadow
- BackColor = &H00808080&
- BackStyle = 1 'Opaque
- BorderStyle = 0 'Transparent
- Height = 285
- Left = 135
- Top = 135
- Width = 5865
- End
- Begin VB.Label lblStatbar
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BorderStyle = 1 'Fixed Single
- BeginProperty Font
- Name = "Courier New"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 240
- Left = 45
- TabIndex = 14
- Top = 2205
- Width = 5910
- End
- Begin VB.Shape Shape1
- BackColor = &H00808080&
- BackStyle = 1 'Opaque
- BorderStyle = 0 'Transparent
- Height = 240
- Left = 90
- Top = 2250
- Width = 5910
- End
- Attribute VB_Name = "frmBitSetOperations"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Public maxLimit As Long
- Public BinaryOn As Boolean
- Private Sub cmdand_Click()
- Dim andValue As Long
- andValue = GetNumber("Enter Number to be use in And", 65535)
- lblStatbar.Caption = "and " & TNumber & ", " & andValue
- txtNumber = WNumber(TNumber And andValue)
- txtNumber.SetFocus
- End Sub
- Private Sub cmddone_Click()
- Unload Me
- End Sub
- Private Sub cmdeqv_Click()
- Dim eqvValue As Long
- eqvValue = GetNumber("Enter Number to be use in Equvalent", 65535)
- lblStatbar.Caption = "eqv " & TNumber & ", " & eqvValue
- txtNumber = WNumber(TNumber Eqv eqvValue)
- txtNumber.SetFocus
- End Sub
- Private Sub cmdimp_Click()
- Dim impValue As Long
- impValue = GetNumber("Enter Number to be use in Impression", 65535)
- lblStatbar.Caption = "imp " & TNumber & ", " & impValue
- txtNumber = WNumber(TNumber Imp impValue)
- txtNumber.SetFocus
- End Sub
- Private Sub cmdnot_Click()
- '
- ' To pass the Signed NOT operator of Visual Basic, i used another
- ' function, i called it not_()
- '
- lblStatbar = "not " & TNumber
- txtNumber = WNumber(not_(TNumber))
- txtNumber.SetFocus
- End Sub
- Private Sub cmdor_Click()
- Dim orValue As Long
- orValue = GetNumber("Enter Number to be use in Or", 65535)
- lblStatbar.Caption = "or " & TNumber & ", " & orValue
- txtNumber = WNumber(TNumber Or orValue)
- txtNumber.SetFocus
- End Sub
- Private Sub cmdrol_Click()
- Dim rolValue As Long
- rolValue = GetNumber("Enter Number to be use in Rotating", 8)
- If Len(int2bin(TNumber)) > Len(int2bin(rolValue)) Th)) Th))er Number to be use in Rotating", 8)
- If Len(int2bin(TNumber)) > Len(int2binl8cr NumbIo0iaLen(int2bin(rolValue)) Th)) use in Or",pe 4
- 7.a = se in3=e 4
- 7.a = sn6", 4
- 7.a = se in3=e 4
- 7 r Th)) Th))er Numb cy txtNumber.SetFocus
- End s8 > Len
- If Le=d s85seiaLen(int2bin(rolValue)) Th)) use in Or",pe 4 To = se in3=e 4
- 7.a = sn6", 4
- 7.a = se in3=e 4
- 7 r Th)) Th))er Numb cy)) > Len(int2binl8cr NumbIo0iaLen(int2bin(rolValue)) Th)) use 285
- Left oLen
- If Le=d s85seiaLen(int2bin(rolValue)) Th)) use in Or",pe 4 To = 60> '5,E"50Ne sn6", 4
- 7.a = se in3=e 4
- 7 r Th)) Th) 4
- xiia0 = se in3=e ne)) Tho3333333333o se in3=e 4
- 7 r Th)) Th))er Ngt in Impression", 65535)
- lblStatbar.Caption = "imp " & TNumbc0g"aptq9um 4
- 7.alValue)) Th)) s"aptq9u87H 1 'Opaque
- Borderut2 Thrut2 Thrut2 Thrut2 ThruOfkdth = 975
- 2 'Falseyqv eqvValue)
- Styg 2sFalseyqv eqvValue)
- Styg 2sFalseyqv eqvValue)
- Styg 2sFalseyqv eqvValue)
- St2 'Falseyd
- Begin VB.Shape shShadow
- BackColor = &H00808080&
- BackStyle g)rv
- BackStyle = 1 'Opaque
- BorderStyle = 0 'Transparent
- Heigh0BValue)
- Styg 2sFalseyqptioabNumEP
- tHtse in Or",iOBte6550.c9yle yleP
- eigh0BVal(o5alickosFayqv eqvValue)
- ue)t5N t0Hptq9u87H 1 'Opaque
- Borderut2 Thrut2 Thrut2 Thrut2 ThruOfkdth = 975
- 2 8(aP< = 975&
- 3FalsStyle g)rv
- On As BooleanF9Fayiorut2 ThruOfkOpaqlue)
- ue)t5N t0Hptq9u87H 1 BooleanF9mEP
- t g)rv
- On As BooleanF9Fayiorut2 ThruOfkOpaqluFayianF9mEP
- t g)rv
- On As BooleanF9Fayiorut2 Thrrrr
- ue)t5N t0Hptq9u87H 1 lr.Caption = 90BVal(o5alickosFayqv eqvValue)
- ue)t5N use in Orc .Orc .Orc .Orc .Orc .Orc .7O2Le=d s85s5Opaque
- Borderut2 Thrut2 Thrut2 Thrut2 ThruOfkdth = 975
- 2 8(aP< s8n.1d = 975
- 2 8(aP< , OnuitvavValu
- le yleP
- eif 3Bus1d ylePaOvavValu
- >arent
- t7 &ircrashc0etFocus
- 72ayiorut2 Thrrrr
- ue)t5N t0Hp
- ' T2ayiorut2wt<e Sub cmdand_Click()
- Dim andValue As Long
- andValue = GetNumber("Enter Numbe)xon=T ' T2ayiorut2wt<e Sub cmdand_Click()
- Dim andValue As Long
- andValue = Getoisby 2 8(aP< , OnuitvavValu
- le yleP
- eif 3Bus1d ylePaO:_ = 285
- Left = 135
- ut2 Thrut2 Thrut2 ThruOfkdth 'Opaque
- dand_Clicu Unlo_ cu Unl) {C, Thrut2 s8 Wir1roE2 T us6N1eer.SetFocohrut2 Thruim aUnl) {C, ThmWNumber(TNumber 7aO:_ = 285
- Left g)rv
- OnndValue A4x2 Troperty Font
- rv
- 8biv5A5eriValuU.t 'OCbar Eqri5eriValuU.t 'OCbar Eqrired0riValuUaeu8uU.t Thmp)
- DiRw l
- impi8uU.t Thmp)
- gh= 135
- ut2Ofkdth 'Opaque
- dand_Clicu Unlo_ cu Unl) {C, Thrut2 s8 Wirber.=r.Caption = 90BVal(o5alickosFayqv eqvValPeu8uU.Number(
-